package com.xiegang.apipassenger.controller;

import com.xiegang.apipassenger.Service.TokenService;
import com.xiegang.internalcommon.dto.ResponseResult;
import com.xiegang.internalcommon.response.TokenResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xieGang
 * @description
 * @date 2023/3/5 19:39
 **/
@RestController
public class TokenController {

    @Autowired
    private TokenService tokenService;

    @PostMapping("/refreshToken")
    public ResponseResult refreshToken(@RequestBody TokenResponse tokenResponse){
        String refreshToken = tokenResponse.getRefreshToken();
        return tokenService.refreshToken(refreshToken);
    }
}
